home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGMISC / FPCDOCS.LZH / DEFAULT.SEQ < prev    next >
Text File  |  1988-07-19  |  1KB  |  33 lines

  1. \ DEFAULT       Open file specified from command line.  by Tom Zimmer
  2.  
  3. \ Link this file into the FILELIST chain.
  4.  
  5. FILES DEFINITIONS
  6.  
  7. VARIABLE DEFAULT.SEQ
  8.  
  9. FORTH DEFINITIONS
  10.  
  11. 128 CONSTANT DOS-LINE
  12.  
  13. : DOS>TIB       ( --- )
  14.                  dos-line count >r tib r@ cmove
  15.                  r@ span ! r> #tib ! >in off ;
  16.  
  17. : HDEFAULT      ( -- )
  18.                 seqhandle clr-hcb dos-line c@ 0<>
  19.                 if      dos>tib                         \ move dosline to tib
  20.                         bl word 1+ c@ ascii - <>        \ is - in place of file
  21.                         if      >in off                 \ reset >IN
  22.                                 seqhandle !hcb          \ load file to handle
  23.                                 seqhandle c@ 0<>        \ anything to open?
  24.                                 if      seqhandle hopen \ did it open ok?
  25.                                         if      >in off \ if not just passon
  26.                                         then    loadline off
  27.                                 then
  28.                         then            \ if first word is - then skip HOPEN
  29.                 then    ;               \ skip whole thing if dosline is null
  30.  
  31. ' HDEFAULT IS DEFAULT
  32.  
  33.